package day4;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        // 给循环代码块取名，用于continue/break
        outerWhile:
        while(true) {
            System.out.println("* * * * *系统菜单* * * * *");
            System.out.println("\t\t1. 用户管理");
            System.out.println("\t\t2. 积分管理");
            System.out.println("\t\t0. 退出");
            System.out.print("请选择：");
            int choose = input.nextInt();
            if(choose == 0) break;
            while(true) {
                if (choose == 0) {
                    break;
                } else if (choose == 1) {
                    System.out.println("* * * * *用户管理菜单* * * * *");
                    System.out.println("\t\t1. 注册");
                    System.out.println("\t\t2. 登录");
                    System.out.println("\t\t9. 回到上一级菜单");
                    System.out.println("\t\t0. 退出");
                    System.out.print("请选择：");
                    int childChoose = input.nextInt();
                    if (childChoose == 1) System.out.println("执行注册");
                    if (childChoose == 2) System.out.println("执行登录");
                    if (childChoose == 9) continue outerWhile;
                    if (childChoose == 0) break outerWhile;
                } else if (choose == 2) {
                    System.out.println("* * * * *积分管理菜单* * * * *");
                    System.out.println("\t\t1. 抽奖");
                    System.out.println("\t\t2. 兑换");
                    System.out.println("\t\t9. 回到上一级菜单");
                    System.out.println("\t\t0. 退出");
                    System.out.print("请选择：");
                    int childChoose = input.nextInt();
                    if (childChoose == 1) System.out.println("执行抽奖");
                    if (childChoose == 2) System.out.println("执行兑换");
                    if (childChoose == 9) break ;
                    if (childChoose == 0) break outerWhile;
                }
            }
        }

        System.out.println("系统退出!");
    }
}
